UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gwvDl/UnMyDca4XFZR+UuyVi9uOaK5K5wlVuBgNouro=' 
WHERE 
  key_id = '74cd4a6ce9504c0a1ea081dc98f0a5a5221fad4c026aecb7b232095fc559d143' 
  AND (
    token = 'gwvDl/UnMyDca4XFZR+UuyVi9uOaK5K5wlVuBgNouro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018