UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YqwwQ4/hP9oIZ+Oiwj/SSWBmv9CQqy8vYUQiPkwPeZA=' 
WHERE 
  key_id = '9225e2923353185235033800609e56f376d1d6a69b93198425bbc38c0d6f59e4' 
  AND (
    token = 'YqwwQ4/hP9oIZ+Oiwj/SSWBmv9CQqy8vYUQiPkwPeZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033