UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yNabyV+LBgvV9Hb6qIcnTM3lomXkbuPrlxDJXt1u7zk=' 
WHERE 
  key_id = '7625a7f0d110f5e3f0631ecdcc0848b1587c48b8443fdc8cfdeaf012c8612f7f' 
  AND (
    token = 'yNabyV+LBgvV9Hb6qIcnTM3lomXkbuPrlxDJXt1u7zk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039