UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Djzh8Lv5UP067oKAioI86NWzmQ4gkmzXkXtyhpC3FQA='
WHERE
key_id = 'dbd58276956aac4cfcf9493ff5cee17218d7316f1f3776b92794762d57985253'
AND (
token = 'Djzh8Lv5UP067oKAioI86NWzmQ4gkmzXkXtyhpC3FQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)