UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EZOoxUxU/8qojh2DeqXEPepnE6ErR0zNAkpQfyvvdL0='
WHERE
key_id = 'a1903b4dd5134b54d6a9738eb32dce4b12e267a10738591fae975ef2b02db268'
AND (
token = 'EZOoxUxU/8qojh2DeqXEPepnE6ErR0zNAkpQfyvvdL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)