UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7xOyWeieoNoTSB6D9gpi3Ih+s56qwIDihDk92wHS2do='
WHERE
key_id = '5c8cbaae1495c3de2fd4e7adf9d4ecdc3101ce585f4cf3bfa8c8364c04c1ff2f'
AND (
token = '7xOyWeieoNoTSB6D9gpi3Ih+s56qwIDihDk92wHS2do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)