UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vNeLMfoXA9aoLX5vzy6vm+SyG3PE2RcjGDNdJJ+Iy1g=' 
WHERE 
  key_id = '4d0eb27260c3d38663361f9099d718eecb4588484a2eaff04b3186f735c3717c' 
  AND (
    token = 'vNeLMfoXA9aoLX5vzy6vm+SyG3PE2RcjGDNdJJ+Iy1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040