UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zy4ZhQeAa3tCQVwiqA+C2ANyFY0yoMdUlH/t5v3TDhI=' 
WHERE 
  key_id = 'bb08a02a8499222c6a476879991b4e1ac275db443bed75623428106979ee9c26' 
  AND (
    token = 'Zy4ZhQeAa3tCQVwiqA+C2ANyFY0yoMdUlH/t5v3TDhI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046