UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1eJxjGCJQonNAd8XszJzCLKxgT8eC+jTIPb48m7QvJE=' 
WHERE 
  key_id = 'cfb6325ca54dc687d0e98ecf5407a6ee7cb76570ee861fd1eb7b0b9d59932ea1' 
  AND (
    token = '1eJxjGCJQonNAd8XszJzCLKxgT8eC+jTIPb48m7QvJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036