UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k2MhONQcKP+Bqk+U8hfgjkirUFnvmSIF+mkG1m9DfPQ=' 
WHERE 
  key_id = '3f03ad78d179d500db5b7a8caa0f64e1f39bb6fe801ac041602b789522eedf1e' 
  AND (
    token = 'k2MhONQcKP+Bqk+U8hfgjkirUFnvmSIF+mkG1m9DfPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031