UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CeGgXfOBY2MqMpLS6ryMMgYXzCUuFq/FE2TSR2UOhm8='
WHERE
key_id = 'a71784d21e68eef75df08f4f8ab5e0d0e34e093caa054e161744231273b78232'
AND (
token = 'CeGgXfOBY2MqMpLS6ryMMgYXzCUuFq/FE2TSR2UOhm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)