UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MaVJVCEUh5wMLqYfXpSi1nS9rZ+8vZ50kcAe2/lSC+Q=' 
WHERE 
  key_id = 'da41cbccccfd5a60ee8a7dec38b196a0dcff661d35fc56fefea25b2cf82a58fa' 
  AND (
    token = 'MaVJVCEUh5wMLqYfXpSi1nS9rZ+8vZ50kcAe2/lSC+Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028