UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sbVJ7amqLOdU/zUxzY8TueVqW3XnQEemTdcQyhiNaUs='
WHERE
key_id = 'a9fe8ffa92a8b5b0e75fff05e37cbe27a1d4203c87f052a86523f3f031f195da'
AND (
token = 'sbVJ7amqLOdU/zUxzY8TueVqW3XnQEemTdcQyhiNaUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)