UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gajKExGVEV3Cu9uR/Szne6k2jTcSk0XecYgdCrVR/6o='
WHERE
key_id = 'c33ea1d9a2e79a7e9b5550c58db74eb97c2dc8cdb640982735fc87967c86c84c'
AND (
token = 'gajKExGVEV3Cu9uR/Szne6k2jTcSk0XecYgdCrVR/6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)