UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lUc9rb4lXKg+SrKCs+g5hYbyHs4s9VRxmOid9DsLp14='
WHERE
key_id = 'e26dc9068d35f75234647879f8ea1c113399cd13aa058bbb61d665b1ff827741'
AND (
token = 'lUc9rb4lXKg+SrKCs+g5hYbyHs4s9VRxmOid9DsLp14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)