UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8MqN7P5KgT6r2i/9HDpfCEwtaz/9ZOsSXv+vhny/W20='
WHERE
key_id = '10e43ae75c0d9be787559116bdec408dc5bd5c6a75cccc064dbb053042944a87'
AND (
token = '8MqN7P5KgT6r2i/9HDpfCEwtaz/9ZOsSXv+vhny/W20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)