UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q+fOVzaNRWDQ4JTU/X6k2oO0nm1jka5D0nHmQvpw5f0=' 
WHERE 
  key_id = '6f83a44b3e4f9cb8109295e533e3be38dee1d509be74b8872ef15445e80b4b42' 
  AND (
    token = 'q+fOVzaNRWDQ4JTU/X6k2oO0nm1jka5D0nHmQvpw5f0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031