UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+ciSOXOMMcw/RSvheuuw9jFvk90spgIWypaTG2NKVu4=' 
WHERE 
  key_id = '7c56d844db291d6bc06a16790f36e589a44cf8dadd1bc162af911996526aa776' 
  AND (
    token = '+ciSOXOMMcw/RSvheuuw9jFvk90spgIWypaTG2NKVu4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029