UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oddkX0x3y8EpzmPvkuWiVdf+BjfolIi0xXJ+FqwTgX8='
WHERE
key_id = 'd1376d7a56da095f4804c27817beba78b000b40b422b92e815a8b5145fb2f0b6'
AND (
token = 'oddkX0x3y8EpzmPvkuWiVdf+BjfolIi0xXJ+FqwTgX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)