UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FFTO/RnbO65rkTq81/qdtj5f2GjsoWZGkF+yFpNYSMY='
WHERE
key_id = 'ca95c68a6951b4b2e96e5ff8ffa0b464a39c5f776b432ccb3cf997260ecb1522'
AND (
token = 'FFTO/RnbO65rkTq81/qdtj5f2GjsoWZGkF+yFpNYSMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)