UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pzTm2vVHAmNa1v9vgVbtdQ1Rtw8cnipwXDo0kXSmyu8=' 
WHERE 
  key_id = '3cb90ec2b04aeb23ac7a3a61534c0c963928e3980f06d71def0af6e2b0d1d0a8' 
  AND (
    token = 'pzTm2vVHAmNa1v9vgVbtdQ1Rtw8cnipwXDo0kXSmyu8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039