UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MPYcYysJ29Fhde0+vRNFXI+WkCJDB4cGrc+OTzZjEKY='
WHERE
key_id = '1879ad7b717a60352ed7a26690169f7656683ff4a23c92f18827b9d73d20ad07'
AND (
token = 'MPYcYysJ29Fhde0+vRNFXI+WkCJDB4cGrc+OTzZjEKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)