UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8B/NSQMCO0SFrKRKe9O6EMsCM6e0TF5+xWWFbPuVyqc=' 
WHERE 
  key_id = '0d208144b6989ff5c6801509219d6c82e5cb21b6fc613f97741c64689b6bc9a6' 
  AND (
    token = '8B/NSQMCO0SFrKRKe9O6EMsCM6e0TF5+xWWFbPuVyqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030