UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cbrfrU81KZS2MIc4DOjPI3TTvg/1HjzT/ldh+XP5Zv4=' 
WHERE 
  key_id = '494e37cea3b37fc7efed1cc5117b3073d0ba0a216b5d072315fed9adab1c5d48' 
  AND (
    token = 'cbrfrU81KZS2MIc4DOjPI3TTvg/1HjzT/ldh+XP5Zv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027