UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gHxB3p47yh2/iGyrVLH5URECxu2+xTvEu/qZmm6D+eE=' 
WHERE 
  key_id = 'd9073bd74d97f0d7c110295db1099d61eff79cd84da314be7d1f5f9d4a4e85bc' 
  AND (
    token = 'gHxB3p47yh2/iGyrVLH5URECxu2+xTvEu/qZmm6D+eE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073