UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IVRxsX7V01MD/Y5E1fb8bL0k73Ouz5YaCg5/6J4QwM8='
WHERE
key_id = '9a0ce369bd1c1e9193fbb0675c4b250a1ec1eecbbebbd9db89e51e385dd3ccbd'
AND (
token = 'IVRxsX7V01MD/Y5E1fb8bL0k73Ouz5YaCg5/6J4QwM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)