UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tCOs3tdKRxrw0/gTPEECaLsF60+xaesPEYa3TKmlEqY='
WHERE
key_id = 'd8b9e4971bd4cee037e4c782e11f44766806ebd007b7b8bc15f497b80748bd9c'
AND (
token = 'tCOs3tdKRxrw0/gTPEECaLsF60+xaesPEYa3TKmlEqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)