UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J59cIKH/Y426mg4BEyirAlr2LoyLA8mZZ/mapnDEULM='
WHERE
key_id = 'cfe3424b1cc2e095bfdb318a24288af7071003ea0af26983a46f60335b46f828'
AND (
token = 'J59cIKH/Y426mg4BEyirAlr2LoyLA8mZZ/mapnDEULM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)