UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KrYb21mRP3raUYmIOwTuKOl3Z6rtyiuq5cZuDC4v/uA=' 
WHERE 
  key_id = '5e313fd4a4cbc914bc8ff0e3a35f71747ee0af6d5037ed63e819282ff2c79a15' 
  AND (
    token = 'KrYb21mRP3raUYmIOwTuKOl3Z6rtyiuq5cZuDC4v/uA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034