UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+KCODRnvyreN7um9jhqhqNDs6g9L1oCLZFJhUh6l4ng='
WHERE
key_id = '58ba5992abd58dc61abf0972f2d03d43f308d09c69080a96e58ae1b9e8834f9b'
AND (
token = '+KCODRnvyreN7um9jhqhqNDs6g9L1oCLZFJhUh6l4ng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)