UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y6eQPTNIixQkzpdib1EuMUyRGERcAgNX22sDzTvNDE0=' 
WHERE 
  key_id = 'df8e0ce336a0a6bca559836a02e007b908099f785ed032689a75ed9921127639' 
  AND (
    token = 'y6eQPTNIixQkzpdib1EuMUyRGERcAgNX22sDzTvNDE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042