UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jZzXt8B99hgmhRwuk7jyoeBMgYYfBhJM8DfUwKCY9/A=' 
WHERE 
  key_id = '092d0b4137cf1023c6961c4cc2e192fbf4c002cf4e392021dd0dfed40cb9bccd' 
  AND (
    token = 'jZzXt8B99hgmhRwuk7jyoeBMgYYfBhJM8DfUwKCY9/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049