UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '83Bf+Avp0cRXCTL2dYaFEQ1xWlit/b49ukKJtyqHJME=' 
WHERE 
  key_id = '15ad6b83823cb532540410f2ecc8f121dd3edda25c4cd16c94e6a3db2937158c' 
  AND (
    token = '83Bf+Avp0cRXCTL2dYaFEQ1xWlit/b49ukKJtyqHJME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032