UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cp/D4pvlD8JOQNOKbWHN0TGbcSVJhjbD/JaeIq/ynzE='
WHERE
key_id = 'ae3903dbd505be340204f4a8c69e50296e639da62a1fa320b1f85ebe764fbeff'
AND (
token = 'Cp/D4pvlD8JOQNOKbWHN0TGbcSVJhjbD/JaeIq/ynzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)