UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbn7zCG/Q9Ku+m8Jpiojym84i/TMojUhTuJ61LamUoE=' 
WHERE 
  key_id = 'db71e8d8c21a04fcfa44e912a8ad8c9ff568f0136992f9c26ba8e6767ccc755c' 
  AND (
    token = 'vbn7zCG/Q9Ku+m8Jpiojym84i/TMojUhTuJ61LamUoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052