UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ziO81xDzJ5cDR/vq1j7zEb0WyYoFJNv0BaHQ2IVcxQs=' 
WHERE 
  key_id = 'cd1288d26292de29d278528ecf3e04de32c5dce52dfa34fda2cdc96e76072ccd' 
  AND (
    token = 'ziO81xDzJ5cDR/vq1j7zEb0WyYoFJNv0BaHQ2IVcxQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075