UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Ce5knXWZxQME2qcu9MyaIdhk8282E3C0yskXA4OT6w=' 
WHERE 
  key_id = '556372612413841934aa88f7818ba2693b27bfb817ab36b14682bcfe085c9ffe' 
  AND (
    token = '1Ce5knXWZxQME2qcu9MyaIdhk8282E3C0yskXA4OT6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023