UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9YS0sFJFSrZ2TF7eEsDg1XhMyGkz6d1xPbkVRO4kU4k='
WHERE
key_id = '58ba61d0fe552ebed6040ff88dd559b3b143b7452de00a2551624284d9de66e2'
AND (
token = '9YS0sFJFSrZ2TF7eEsDg1XhMyGkz6d1xPbkVRO4kU4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)